<template>
<div class="main">
  <div>{{all_myrest_QueryKnowledgeGroup==null?'':''}}</div>
  <div>{{all_myrest_vediodata_QueryHaveBoughtKnowledgeGroup==null?'':''}}</div>
  <div>{{wendaData ===null?'':''}}</div>
  <!-- <div class="header"> -->
  <!--   <div class="header_tit">投资学堂</div> -->
  <!--   <a href="../newindex.html"> <div class="goback"><img src="../assets/images/gobackbtn.png" /></div></a> -->
  <!--   <div class="header_yigou">已购课程</div> -->
  <!-- </div> -->
   <!-- <div>all_myrest_QueryKnowledgeGroup：：：：：{{all_myrest_QueryKnowledgeGroup==null?'':all_myrest_QueryKnowledgeGroup}}</div> -->
   <!-- <div>all_myrest_SPXT_QueryKnowledgeGroup:::{{ all_myrest_SPXT_QueryKnowledgeGroup==null?'':all_myrest_SPXT_QueryKnowledgeGroup}}</div> -->
  <!-- <div>wendaData:===================={{wendaData}}</div> -->
  <!--<div>vedioData:>>>>>>>>>>>>>>>>>>>>{{vedioData}}</div>-->
  <div class="ke_nav">
      <div class="nav_item">
          <router-link :to="{path:'/WendaClassify'+ '/' }">
          <!--<a href="buy.html">-->
              <div class="item_icon"><img src="../assets/images/ke_icon_zhishi.png" /> </div>
              <div class="item_tit">知识问答</div>
          <!--</a>-->
          </router-link>
      </div>
      <div class="nav_item">
        <router-link to="VideoClass">
          <div class="item_icon"><img src="../assets/images/ke_icon_shipin.png" /> </div>
          <div class="item_tit">视频学堂</div>
        </router-link>
      </div>
      <div class="nav_item">
        <router-link to="/VideoCourse">
          <div class="item_icon"><img src="../assets/images/ke_icon_xuexi.png" /> </div>
          <div class="item_tit">学习计划</div>
        </router-link>
      </div>
  </div>
  <div class="youxuan">
    <div class="youx_tit">优选 · 推荐</div>
    <div class="youx_pic"><img src="../assets/images/youx_pic.png" /> </div>
  </div>

  <div class="wenda">
    <!--列表模块知识问答-->

    <div class="list_module">
        <div class="wenda_tit">知识 · 问答</div>
        <div class="wenda_item_list clear" id="wenda_item_list">
            <div class="wenda_item" v-for="item in wendaData">
                <router-link :to="{path:'/WendaPreview'+ '/' + item.id}">
                <!--<a v-bind:href="'preview.html?groupId='+item.id">-->
                    <div class="item_pic"><img v-bind:src="item.cover" /> </div>
                    <div class="item_tit">{{item.title}}</div>
                    <div class="item_price_info">
                        <div class="money_icon"><img src="../assets/images/money_icon.png" /> </div>
                        <div class="jf_num">{{item.buyReward}}</div>
                        <div class="price">￥<span>{{(item.price)/100}}</span></div>
                    </div>
                <!--</a>-->
                </router-link>
            </div>

        </div>
    </div>

    <!-- shi频学堂i  -->
    <div class="list_module suibian">
      <div class="wenda_tit">视频 · 学堂</div>
      <div class="wenda_item_list clear" id="shipin_item_list">
        <div class="wenda_item" v-for="shipin in vedioData">
          <router-link   :to="'/Vclassdetail/' + shipin.id">
            <div class="item_pic"><img v-bind:src="shipin.cover" /> </div>
            <div class="item_tit">{{shipin.title}}</div>
            <div class="item_price_info">
              <div class="money_icon"><img src="../assets/images/money_icon.png" /> </div>
              <div class="jf_num">{{shipin.buyReward}}</div>
              <div class="price">￥<span>{{(shipin.price)/100}}</span></div>
            </div>
          </router-link>
        </div>
      </div>
    </div>

  </div>
</div>
</div>
</template>

<script>
  import stores from './mystore.js'
  import Vue from 'vue';
  import { XButton, XInput,Group, Tab, TabItem } from 'vux'
  import { mapGetters,mapActions } from 'vuex'
  import sha1 from 'js-sha1'

  export default {
    data(){
      return {
          jincheng:1,
          wendaData:'',
          vedioData:'',
          successMsg:"",
          items:[1,2,3,4,5],
          mypayload:{
              key:"ke",
              url:'baseapi',
              actionName:"QueryKnowledgeGroup",
              postData: {
                  "haveVideo":"false",
                  "pageNo":1,
                  "pageSize":6
              }
          },
          mypayloadvideo:{
              key:"vediodata",
              url:'baseapi',
              actionName:"QueryKnowledgeGroup",
              postData: {
                  "tagIds":"SPXT",
                  "pageNo":1,
                  "pageSize":4
              }
          },
      }
    },

    computed:{
      all_myrest_QueryKnowledgeGroup(){
        var x = this.$store.getters.all_ke.body;
        if (x) {
          this.wendaData= x.knowledgeGroupList;
          return  x

        }
      },
      all_myrest_vediodata_QueryHaveBoughtKnowledgeGroup(){
        var x = this.$store.getters.all_restful_vediodata_QueryHaveBoughtKnowledgeGroup.body;
        if (x) {
          this.vedioData= x.knowledgeGroupList;
          return  x

        }
      },

//       all_myrest_QueryKnowledgeGroup(){      all_restful_vediodata_QueryHaveBoughtKnowledgeGroup
//         var dataval=this.$store.getters.all_restful_QueryKnowledgeGroup;
//         var testData={"myname":"dongguang"}
//         if(dataval){
//           if(this.jincheng==1){
//             this.jincheng=2;
//           }else{
//             this.vedioData=dataval.body.knowledgeGroupList;
//           }
//           return dataval.body.knowledgeGroupList
//         }else{
//           return null
//         }
//         //return dataval;
//       },
      all_nots(){
        return this.$store.getters.all_nots
      },
      all_login(){
        return this.$store.getters.all_login
      },
      ...mapGetters([ 'evenOrOdd'
      ])
    },
    created (){
      this.cntReady();
// console.info(this.all_myrest_vediodata_QueryHaveBoughtKnowledgeGroup);
// console.info(this.all_myrest_QueryKnowledgeGroup);
  // all_myrest_vediodata_QueryHaveBoughtKnowledgeGroup
  // <div>查询收费课程组：：：：：：：：：{{all_myrest_QueryKnowledgeGroup}}</div>
      this.setTimeoutTest();
    },

    methods:{
      setTimeoutTest:function(){
          var that=this;
          setTimeout(function(){
              that.$store.commit('restful_api',that.mypayloadvideo);
          },200)
      },

      cntReady(){
        this.$store.commit('restful_api',this.mypayload);
        //alert(2)
      },

      ...mapActions([
        'increment',
        'decrement',
        'incrementIfOdd'
      ]),
    },
    components: { XButton, Group, XInput, Tab, TabItem }

  }

</script>

<style scoped>
  *{ margin: 0; padding: 0;}
  body{ background-color: #eee;}
  a{ text-decoration: none; color: #000;}
  .clear:after{ display: block; clear: both; content: ''; height: 0;}
  div img{ width: 100%; display: block;}

  /*** 顶部 header ***/
  .main{ background-color: #eee;}
  .header{ background-color: #f5f5f5; border-bottom: 1px solid #e5e5e5; position: relative; padding: 15px 0;}
  .header_tit{ text-align: center; font-weight: bold; font-size: 18px; }
  .goback{ width: 20px; position: absolute; left: 20px; top:16px;}
  .goback img{ width: 13px;}
  .header_yigou{ position: absolute; right: 20px; top:16px; color: #828b93; font-size: 14px;}

  /*** 顶部 分类导航 ***/
  .ke_nav{ background-color: #fff; display: box; display: -webkit-box; padding: 15px 0;}
  .nav_item{ -webkit-box-flex: 1;}
  .item_icon{ width: 28px; margin: 0 auto; margin-bottom: 10px;}
  .item_tit{ text-align: center; font-size: 12px;}

  /*** 优选推荐 ***/
  .youxuan{ background-color: #fff; margin-top: 10px;}
  .youx_tit{ text-align: center; padding: 10px 0;}

  .wenda{ margin-top: 10px; padding: 0px;}
  .list_module{ background-color: #fafafa; margin-bottom: 10px; }
  .suibian {padding-bottom:35px}
  .wenda_tit{ font-size: 14px; position: relative; padding: 10px 15px;}
  .wenda_item{ float:left; width: 50%; box-sizing: border-box; -webkit-box-sizing:border-box; padding: 0 10px; margin-bottom: 15px;}
  .wenda_item .item_tit{ text-align: left; margin: 5px 0;}
  .item_price_info{ display: box; display: -webkit-box; font-size: 12px;}
  .item_price_info div{  box-sizing: border-box; -webkit-box-sizing:border-box;}
  .money_icon{ width: 13px; padding-top: 3px; }
  .jf_num{ -webkit-box-flex: 1; color: #999; margin-left: 5px;}
  .price{ width: 80px; text-align: right;}

  .item_pic{ height: 97px;}






</style>






